<%= simple_form_for @topic, html: { class: "form" } do |f| %>
  <%= render "shared/error_messages", target: @topic %>
  <div class="form-group">
    <% if can? :change_node, @topic %>
    <div class="input-group">
      <span class="node-select input-group-btn">
        <%= render_topic_node_select_tag(@topic) %>
      </span>
      <%= f.text_field :title, class: "form-control", placeholder: "在这里填写标题" %>
    </div>
    <% else %>
      <%= f.text_field :title, class: "form-control", placeholder: "在这里填写标题" %>
    <% end %>
  </div>

  <%= render "editor_toolbar" %>

  <div class="form-group">
    <%= f.text_area :body, class: "topic-editor form-control closewarning", rows: 20 %>
  </div>

  <div class="form-group">
    <%= f.submit t("common.save"), class: "btn btn-primary col-xs-2", 'data-disable-with' => t("common.saving") %>

    <div class="pull-right"><a href="/markdown" target="_blank"><i class="fa fa-tip"></i> 排版说明</a></div>
  </div>
<% end %>
